package ink.xiaobaibai.parameterValid;

/**
 * @description: 参数校验结果对象
 * @author: 小白白
 * @create: 2021-05-24
 **/

public class ParameterResult {

    public ParameterResult(String errorMsg) {
        this.valid = false;
        this.errorMsg = errorMsg;
    }

    private ParameterResult() {
        this.valid = true;
    }

    private boolean valid;

    private String errorMsg;

    public boolean isValid() {
        return this.valid;
    }

    public String getErrorMsg() {
        return this.errorMsg;
    }

    public static ParameterResult ok() {
        return new ParameterResult();
    }

    public static ParameterResult fair(String errorMsg) {
        return new ParameterResult(errorMsg);
    }

}
